package wechat

import (
	"gitee.com/ifinder/gocomm"
	"gitee.com/ifinder/wechat-ipad-sdk-golang/wechat/msg"
)





// 个人同步微信消息
func (this *WechatApi) SyncMessage(req *msg.SyncMessageReq) (*msg.SyncMessageResp,error) {

	resp:= msg.NewSyncMessageResp()

	uri:=this.serviceUrl+"/718/Msg/Sync"
	res,err:=gocomm.PostJSON(uri,req)

	err=resp.FromJson(res)

	return resp,err

}





// 发送文本消息
func (this *WechatApi) SendTxtMessage(req msg.SendTxtMessageReq) (*msg.SendTxtMessageResp,error) {

	resp:= msg.SendTxtMessageResp{}
	uri:=this.serviceUrl+"/718/Msg/SendTxt"

	res,err:=gocomm.PostJSON(uri,req)

	err=resp.FromJson(res)

	return &resp,err

}


// 发送图片消息
func (this *WechatApi) SendImageMessage(req msg.SendImageMessageReq) (*msg.SendImageMessageResp,error) {

	resp:= msg.SendImageMessageResp{}
	uri:=this.serviceUrl+"/718/Msg/UploadImg"
	res,err:=gocomm.PostJSON(uri,req)
	err=resp.FromJson(res)

	return &resp,err

}


// 发送视频消息
func (this *WechatApi) SendVideoMessage(req msg.SendVideoMessageReq) (*msg.SendVideoMessageResp,error) {

	resp:= msg.SendVideoMessageResp{}
	uri:=this.serviceUrl+"/718/Msg/SendVideo"
	res,err:=gocomm.PostJSON(uri,req)
	err=resp.FromJson(res)

	return &resp,err

}







